<?php
require '../config.php';
$result = mysql_query("SELECT max(idrutas) as maxruta FROM hossbd.rutas limit 1",$conexion) or die("Problemas al guardar datos.".mysql_error()); 
$data = array();
if(mysql_num_rows($result)>0){
	$row = mysql_fetch_array($result);
	$data[] = $row['maxruta'];
	echo json_encode($data);
}else{
	echo 0;
}
?>